/*
 * @Date: 2022-03-29 12:47:19
 * @LastEditors: Andy
 * @LastEditTime: 2022-04-11 18:04:42
 * @LastEditors: luoqi
 * @LastEditTime: 2022-03-29 18:41:03
 * @FilePath: /payment/pay/src/pages/AgencyTenant/AgencyTenantInfo.jsx
 */
import React, { useState, useEffect } from 'react';
import erweiImg from '../../assests/images/二维码.png'
import {
  Form,
  Input,
  Switch,
} from 'antd';
import Tabs from '../../components/Tabs'
import axios from '../../util/axios'

export default function AgencyTenantInfo() {
const[infoForm]=Form.useForm()
let ProduceOneInfo={
  nickname:'test',
  store_id:'122222112',
  md5_secret:'lkdhuaoigjfg',
  money:'10.0',
  ziDongShenHe:'checked'
}
  //表单默认内容
useEffect(()=>{
  axios({
    method:'GET',
    url:'DaiLi/ShangHuXinXi/select',
  }).then(res=>{
   let Data=res.data
    if(res.data.ziDongShenHe=='0'){
      Data.ziDongShenHe=''
    }else{
      Data.ziDongShenHe='checked'
    }
    console.log(Data);
    infoForm.setFieldsValue(Data)
  })
},[])
  
  return (
    <div>
      <Tabs title={'商户资料'}>商户资料</Tabs>
      <Form
      form={infoForm}
      labelCol={{ span: 4 }}
      wrapperCol={{ span: 6 }}
      layout="horizontal"
      style={{'margin':'20px 0' }}
      initialValues={ProduceOneInfo}
    >
      <Form.Item label="商户名称" name='nickname' >
        <Input />
      </Form.Item>
      <Form.Item label="商户号" name='store_id'>
        <Input />
      </Form.Item>
      <Form.Item label="MD5 Secret" name='md5_secret'> 
      <Input.TextArea  />
      </Form.Item>
      <Form.Item label="商户余额" name='money'>
        <Input />
      </Form.Item>
      <Form.Item label="谷歌认证二维码">
      <div>
      <img src={erweiImg}/>
      </div>
      </Form.Item>
      
      <Form.Item label="自动审核" valuePropName="checked" name="ziDongShenHe">
        <Switch />
      </Form.Item>
    </Form>
   
    </div>
  )
}
